# Create an RMarkdown Document
- Open the "File" menu in RStudio
- Select the "New File" option
- Select the "R Markdown..." option
- Keep the defaults (HTML Document) and hit "Ok"
- Open the "File" menu
- Select the "Save" option
- Note that it defaults to the project folder
- Give it a name like "Day 1A" (or whatever)
- Note that the file extension is .Rmd
# Remove the boilerplate content
- The top part of the notebook is called the "Header"
- Don't delete the header or the notebook won't work
- You can change the title but keep it in quotes
- Highlight and delete everything below the header
# Enter the Visual Editor
- Click on the "Visual" button at the top
- Check the box for "Knit on Save"
- Save by clicking the disk icon
- Look at the preview in the "Viewer" tab
# Add Formatted Text (i.e., Markdown)
- Below the header you can add formatted text
- Use the visual editor to add formatting easily
- Show how to add bold, italics, headers, etc.
- Mention that you can add links, figures, and tables too
# Add R Chunks (i.e., R code)
- Click the green "Insert a new code chunk" button (top right)
- Show how you can also do this quickly by typing / in Visual editor
- Inside the chunk, you can type R commands like a mini console
- Try doing some calculations in the chunk and hit the green arrow
- The answer appears right below the chunk!
- If we save and knit the document, it appears there too
- We can share the .html file with others
- It will include all the formatted text, code, and R's answers